package com.ruoyi.merchant.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: lw
 * @Date: 2023-02-14-11:02:08
 * @Description: 类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    private Integer code;

    private String message;

    private Object data;

    public static Result success(){
        return new Result(1000,"操作成功",null);
    }

    public static Result success(Object data){
        return new Result(1000,"操作成功",data);
    }

    public static Result error(String message){
        return new Result(2000,message,null);
    }

    public static Result tokenError(String message){
        return new Result(3000,message,null);
    }

}
